package com.elitesland.org.entity;

import com.elitesland.core.base.BaseModel;
import com.elitesland.system.annotation.Comment;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Objects;

@Entity
@Table(name = "org_employee_tag_ref")
@org.hibernate.annotations.Table(appliesTo = "org_employee_tag_ref", comment = "雇员标签关系表")
@Data
@Accessors(chain = true)
@ApiModel(value = "雇员标签关系表", description = "雇员标签关系表")
public class EmployeeTagRefDO extends BaseModel implements Serializable {

    @ApiModelProperty(value = "雇员记录ID")
    @Comment("雇员记录ID")
    @Column()
    Long employeeId;

    @ApiModelProperty(value = "雇员标签名称")
    @Comment("雇员标签名称")
    @Column()
    String tagName;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof EmployeeTagRefDO)) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        EmployeeTagRefDO entity = (EmployeeTagRefDO) o;
        return getId().equals(entity.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId());
    }
}